package lianxi5.正则表达式;

public class test {
    public static void main(String[] args) {
        String qq = "1263a42432";


        System.out.println(qq.matches("[1-9]\\d{5,11}"));
    }

    public static boolean isQQ(String qq) {
        int length = qq.length();
        if (length < 6 || length > 12) {
            return false;
        }

        if (qq.charAt(0) == '0') {
            return false;
        }

        for (int i = 0; i < qq.length(); i++) {
            char c = qq.charAt(i);
            if (c < '0' || c > '9') {
                return false;
            }
        }
        return true;

    }
}
